package com.qf.xiaomi.entity;

import java.util.List;

/**
 * @author 千锋教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
public class PageBean<T> {
    private long totalCount;  //总条数
    private List<T> data; // 页面要展示的数据
    private int pageNum; //当前页面
    private int startPage;  //要展示的第一个页码
    private int endPage;  //要展示的最后一个页码
    private int totalPage; //总页数  Math.ceil( totalCount * 1.0 / pageSize)
    private int pageSize; //每页条数

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getStartPage() {
        return startPage;
    }

    public void setStartPage(int startPage) {
        this.startPage = startPage;
    }

    public int getTotalPage() {
        int tp  = (int) Math.ceil( totalCount * 1.0 / pageSize);
        return tp;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getEndPage() {
        int tp  = (int) Math.ceil( totalCount * 1.0 / pageSize);
        return tp;
    }

    public void setEndPage(int endPage) {
        this.endPage = endPage;
    }
}
